<?php

use yii\helpers\ArrayHelper;

$config = [

    'language' => 'zh-CN',
    'timeZone' => 'PRC',
    'vendorPath' => CMS_ROOT . 'vendor',

    'modules' => [
    ],

    'components' => [
        'authManager' => [
            'class' => 'backend\components\RbacPhpManager',
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=127.0.0.1;dbname=com_tourze_app_cms',
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
            'tablePrefix' => '',
            //'enableSchemaCache' => true,
        ],
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => '192.168.33.10',
            'port' => 6379,
            'database' => 0,
        ],
//        'cache' => [
//            'class' => 'yii\redis\Cache',
//            'redis' => 'redis' // id of the connection application component
//        ],
        'i18n' => [
            'translations' => [
                '*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'sourceLanguage' => 'en-US',
                    'basePath' => '@common/messages',
                    'fileMap' => [
                        'app' => 'app.php',
                    ]
                ],
                'kvselect' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'sourceLanguage' => 'en-US',
                    'basePath' => '@common/messages',
                    'fileMap' => [
                        'kvselect' => 'kvselect.php',
                    ]
                ],
                'vova07/fileapi' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'sourceLanguage' => 'en-US',
                    'basePath' => '@common/messages',
                    'fileMap' => [
                        'vova07/fileapi' => 'fileapi.php',
                    ]
                ],
            ],
        ],
    ],

    'params' => require __DIR__ . '/params.php',
];

if (is_file(__DIR__ . '/main-local.php'))
{
    $config = ArrayHelper::merge($config, require(__DIR__ . '/main-local.php'));
}

return $config;
